package com.hzvictory.hotel_system.common.utils;

import com.github.pagehelper.PageHelper;
import com.hzvictory.hotel_system.common.core.page.PageDomain;
import com.hzvictory.hotel_system.common.core.page.TableSupport;

/**
 * 功能
 * 作者：何征
 * 日期：2025/7/21 18:46
 */
public class PageUtils extends PageHelper {
    public static void startPage()
    {
        PageDomain pageDomain = TableSupport.buildPageRequest();
        Integer pageNum = pageDomain.getPageNum();
        Integer pageSize = pageDomain.getPageSize();
        String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
        Boolean reasonable = pageDomain.getReasonable();
        PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
    }
}
